package com.mspbots.ticketai.service;

import com.mspbots.api.page.Page;
import com.mspbots.ticketai.model.Ticket;
import com.mspbots.ticketai.model.TicketOnly;
import com.mspbots.ticketai.model.TicketRule;
import com.mspbots.ticketai.model.TicketSchedule;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * com.mspbots.core.ticketai.TicketService
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/8
 */
public interface TicketService {

    /**
     * next page ticket all grade
     *
     * @param params   query prams
     * @param pageable page params
     * @return ticket only
     */
    Mono<Page<TicketOnly>> page(Map<String, Object> params, Page<TicketOnly> pageable);

    /**
     * request next ticket
     *
     * @param params query prams
     * @return
     */
    Mono<TicketOnly> nextTicket(Map<String, Object> params);


    /**
     * next page ticket all grade
     *
     * @param params   query prams
     * @param pageable page params
     * @return ticket only
     */
    Mono<Page<TicketOnly>> pageBySingleRule(Map<String, Object> params, Page<TicketOnly> pageable, TicketRule ticketRule);

    Mono<Page<TicketSchedule>> assignedTicketPage(Map<String, Object> params, Page<TicketSchedule> pageable);

    Flux<Map<String,Object>> getCheckStatus(Ticket ticket);
}
